import { pget, ppostJson,  postFileByFormData } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 证照列表
export function getTableList(query?: any) {
  return pget(`${modalApi.carMessage}/assetscarcertificate/page`, query);
}

// 证照编辑
export function editLicence(data: any) {
  return ppostJson(`${modalApi.carMessage}/assetscarcertificate/update`, data);
}

// 查看证照详情
export function viewLicence(query: any) {
  return pget(`${modalApi.carMessage}/assetscarcertificate/detail`, query);
}

// 批量上传证照
export function batchImg(data: any) {
  return ppostJson(
    `${modalApi.carMessage}/assetscarcertificate/uploadCertificate`,
    data,
  );
}

// 证照导入检查
export const importLicenceCheck = `${modalApi.carMessage}/assetscarcertificate/import/importCheckCertificate`;

// 证照确认导入
export function importLicence(data: any) {
  return postFileByFormData(
    `${modalApi.carMessage}/assetscarcertificate/importCertificate`,
    data,
  );
}

// 导入获取错误数据
export function getLicenceErrorList(query: any) {
  return pget(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/certificetePage`,
    query,
  );
}
